#ifndef VIDEOWIDGET_H
#define VIDEOWIDGET_H

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>

class VideoWidget : public QWidget
{
    Q_OBJECT

public:
    explicit VideoWidget(const QString &title = "视频监控", QWidget *parent = nullptr);
    ~VideoWidget();

    // 获取视频窗口句柄
    WId getVideoWindowHandle() const;
    
    // 设置当前状态
    void setCurrentStatus(const QString &status);
    
    // 设置操作建议
    void setOperationSuggestion(const QString &suggestion);

    // 设置异常状态
    void setAbnormal(bool abnormal);

    // 按钮显示模式枚举
    enum ButtonDisplayMode {
        ShowBothButtons = 0,      // 显示两个按钮
        ShowNormalButtonOnly = 1, // 只显示正常按钮
        ShowAbnormalButtonOnly = 2 // 只显示异常按钮
    };

    // 设置按钮显示模式
    void setButtonDisplayMode(ButtonDisplayMode mode);

signals:
    void normalButtonClicked();
    void abnormalButtonClicked();

protected:
    void resizeEvent(QResizeEvent *event) override;

private:
    void setupUI();
    void setupConnections();
    void setupOverlayUI();

private:
    QWidget *m_videoContainer;
    QWidget *m_overlayWidget;
    
    // 悬浮界面组件
    QHBoxLayout *m_overlayLayout;
    QHBoxLayout *m_statusLayout;
    QHBoxLayout *m_suggestionLayout;
    QHBoxLayout *m_buttonLayout;
    
    QLabel *m_statusLabel;
    QLabel *m_statusValueLabel;
    QLabel *m_suggestionLabel;
    QLabel *m_suggestionValueLabel;
    
    QLabel *m_normalWt;
    QLabel *m_abnormalWt;
};

#endif // VIDEOWIDGET_H
